﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title></title>
    <link href="../../../Scripts/easyUI/themes/default/easyui.css" rel="stylesheet" type="text/css" />
    <link href="../../../Scripts/easyUI/themes/icon.css" rel="stylesheet" type="text/css" />
    <script src="../../../Scripts/jquery-1.7.2.min.js" type="text/javascript"></script>
    <script src="../../../Scripts/jquery.easyui.min.js" type="text/javascript"></script>
    <script src="../../../Scripts/easyUI/locale/easyui-lang-zh_CN.js" type="text/javascript"></script>
    <script src="../js/FormDesignerService.js" type="text/javascript"></script>
    <script language="javascript" type="text/javascript">
        //加载grid
        function LoadGridData(pageNumber, pageSize) {
            this.pageNumber = pageNumber;
            this.pageSize = pageSize;


            var params = {
                action: "GetEnumerationList",
                pageNumber: pageNumber,
                pageSize: pageSize

            };

            ajaxService(params, LoadDataGridCallBack, this, 1);
        }

        //初始化
        $(function () {
            LoadGridData(1, 5);
        });

        //加载grid后回调函数
        function LoadDataGridCallBack(js, scorp) {
            $("#pageloading").hide();
            if (js == "") js = "[]";

            //系统错误
            if (js.status && js.status == 500) {
                $("body").html("<b>访问页面出错，请联系管理员。<b>");
                return;
            }
            var pushData = eval('(' + js + ')');

            $('#newsGrid').datagrid({
                columns: [[
                    { field: 'No', title: '编号', width: 100 },
                    { field: 'Name', title: '名称', width: 140 },
                    { field: 'CfgVal', title: '枚举值', width: 140 }
                ]],
                idField: 'No',
                singleSelect: true,
                data: pushData,
                width: 'auto',
                height: 'auto',
                striped: true,
                rownumbers: true,
                pagination: true,
                fitColumns: true,
                pageNumber: scorp.pageNumber,
                pageSize: scorp.pageSize,
                pageList: [5, 10, 15, 20],
                loadMsg: '数据加载中......',
                onClickRow: function (rowIndex, rowData) {
                    $('#TB_Enumeration_Chinese').val(rowData["Name"]);
                    $('#TB_Enumeration_Field').val(rowData["No"]);
                }

            });
            //分页
            var pg = $("#newsGrid").datagrid("getPager");
            if (pg) {
                $(pg).pagination({
                    onRefresh: function (pageNumber, pageSize) {
                        LoadGridData(pageNumber, pageSize);
                    },
                    onSelectPage: function (pageNumber, pageSize) {
                        LoadGridData(pageNumber, pageSize);
                    }
                });
            }
        }
    </script>
</head>
<body class="easyui-layout">
    <div data-options="region:'center'">
        <div id="tabs" class="easyui-tabs" data-options="fit:true ,border:false">
            <div title="选择已有枚举值" style="width: 600px; height: 600px;">
                <div id="tb" style="padding: 3px;">
                    <input type="button" id="BT_NewlyAdded" onclick="New_event()" value="新增" />
                    &nbsp;&nbsp;
                    <input type="button" id="BT_Edit" onclick="" value="编辑" />
                    &nbsp;&nbsp;
                    <input type="button" id="BT_DELETE" onclick="" value="删除" />
                </div>
                <table id="newsGrid" toolbar="#tb" class="easyui-datagrid">
                </table>
                <table>
                    <tr>
                        <td colspan="2">
                            <br />
                            中文名：
                            <input id="TB_Enumeration_Chinese" class="easyui-textbox" style="width: 200px" />
                            字段英文名：<input id="TB_Enumeration_Field" class="easyui-textbox" style="width: 200px" />
                            <input id="CB_Generate_Tags" type="checkbox" checked="checked" /><label for="CB_Generate_Tags">生成标签</label>
                        </td>
                    </tr>
                </table>
            </div>
            <div title="编辑" style="padding: 10px">
               
            </div>
        </div>
    </div>
</body>
</html>
